Repository navigation
Add typed JSON output to concurrent process rendering - #8804
Merged
Merged
Conversation
isaacroldan
commented
Oct 7, 2026
isaacroldan
force-pushed
the
codex/json-ui-routing
branch
from
October 7, 2026 11:12
441de3f to
a2b5dad
Compare
isaacroldan
removed this pull request from stack #8805
October 7, 2026 11:12
isaacroldan
added this pull request to stack #8813
October 7, 2026 11:13
1 of 4 tasks
gonzaloriestra
approved these changes
Oct 7, 2026
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/system.d.ts@@ -104,9 +104,9 @@ export declare function sleep(seconds: number): Promise<void>;
*/
export declare function terminalSupportsHyperlinks(): boolean;
/**
- * Check if the standard input and output streams support prompting.
+ * Check if standard input and standard error are terminals that support prompting.
*
- * @returns True if the standard input and output streams support prompting.
+ * @returns True if standard input and standard error support prompting.
*/
export declare function terminalSupportsPrompting(): boolean;
/**
packages/cli-kit/dist/public/node/ui.d.ts@@ -21,6 +21,7 @@ interface UIDebugOptions {
skipTTYCheck?: boolean;
}
export interface RenderConcurrentOptions extends PartialBy<ConcurrentOutputProps, 'abortSignal'> {
+ /** Ink options for terminal UI. Finite JSON output uses the command event channel on stderr instead. */
renderOptions?: RenderOptions;
}
/**
packages/cli-kit/dist/private/node/ui/components/ConcurrentOutput.d.ts@@ -1,4 +1,4 @@
-import { OutputProcess } from '../../../../public/node/output.js';
+import { type OutputProcess } from '../../../../public/node/output.js';
import { AbortSignal } from '../../../../public/node/abort.js';
import { FunctionComponent } from 'react';
export interface ConcurrentOutputProps {
@@ -6,14 +6,21 @@ export interface ConcurrentOutputProps {
prefixColumnSize?: number;
abortSignal: AbortSignal;
showTimestamps?: boolean;
+ /**
+ * Keeps terminal UI running after all processes finish. Defaults to false.
+ * In JSON mode, false uses finite progress/diagnostic events; true retains streaming terminal UI.
+ */
keepRunningAfterProcessesResolve?: boolean;
useAlternativeColorPalette?: boolean;
}
interface ConcurrentOutputContext {
outputPrefix?: string;
+ /** Controls ANSI stripping for terminal output. JSON diagnostics are always unstyled. */
stripAnsi?: boolean;
}
declare function useConcurrentOutputContext<T>(context: ConcurrentOutputContext, callback: () => T): T;
+/** Runs finite processes concurrently and routes their output through the shared diagnostic context. */
+export declare function runConcurrentProcessesForJson({ processes, abortSignal, }: Pick<ConcurrentOutputProps, 'processes' | 'abortSignal'>): Promise<void>;
/**
* Renders output from concurrent processes to the terminal.
* Output will be divided in a three column layout
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Finite concurrent processes can write terminal text to stdout in JSON mode and corrupt the command result. This is the shared prerequisite for #8801, stacked on the stderr prompt defaults in #8812.
WHAT is this pull request doing?
Send finite concurrent output as JSON diagnostic and progress events on stderr, with one diagnostic per line across pipe chunks, CRLF endings, and split UTF-8 characters. Strip ANSI codes from diagnostics and keep the existing terminal renderer for streaming callers.
Interactive prompts can share stderr with JSON events. Use
--json --no-inputwhen capturing stderr as JSONL for automation.How to manually test your changes?
With #8801 checked out, use a disposable local app with installed dependencies:
shopify app build --path <app> --skip-dependencies-installation --json --no-input > build.json 2> build.events.jsonl. Check that stdout contains one result and build output appears as JSON events on stderr.--jsonand check that normal build output remains.Validation
169 focused tests, CLI Kit build/type checks, lint, Knip, and code-documentation generation pass. A subprocess check confirms one JSON result on stdout and correctly framed JSON events on stderr, including split UTF-8 and final lines without a newline. CI must rerun after the rebase.
Checklist